<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta name="menu" content="assetMenu" />
<meta name="nav" content="1" />
<meta name="acc" content="0-1-1" />
<title>设备信息</title>
<!--  通用情况下 不引入 js css  表单验证  js 放置到页面中     -->
<script>
	$(document).ready(function() {
		
		 $("input[name='manufacturer']").addClass("Wate").bind("click", function(){
	    	 WdatePicker({skin:'whyGreen',minDate:'1900-10-01',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'});});
			 $("input[name='buyDate']").addClass("Wate").bind("click", function(){
	    	 WdatePicker({skin:'whyGreen',minDate:'#F{$dp.$D(\'manufacturer\')}',maxDate:'%y-%M-%d',dateFmt:'yyyy-MM-dd'});});
		$("#equipmentModel").focus();
		 if('${price}'){
			 $("#fmtPrice").formatCurrency(); 
		 }
		 $("#fmtPrice").blur(function(){
			 $("#price").val($("#fmtPrice").val());
             $("#fmtPrice").formatCurrency();
      	});
		//为inputForm注册validate函数

		$("#chooseItem").click(function() {
			var checkedBox = $("input:checked");
			var itemsId = new String("");
			$.each(checkedBox, function() {
				itemsId += $(this).val() + "_";
			});
			confirm("该设备将在" + checkedBox.length + "个项目中应用？");
			$("#itemsId").val(itemsId);
			$("#submitbtn").removeAttr("disabled");
		});
		$("#inputForm").validate({
			event : "blur",
			rules : {
				equipmentModel:"required",
				sindex:"required",
				brand:"required",
				equipmentNo : {
					remote : "information!checkEquipNo.action?id=${id}"
				}
			},
			messages : {
				equipmentNo : {
					remote : "当前编号已被使用！"
				}
			}
		});
	});

	var popupStatus = 0;
</script>
</head>
<body>
<form action="information!save.action" method="post" id="inputForm"
	class='yform'>
<div id="caption">
<h6>${equipmentModel}设备信息</h6>
</div>
<table class="noborder">
	<tr class="type-title">
		<td colspan="4">设备信息</td>
	</tr>
	<tr class="type-text">
		<td>设备名称</td>
		<td><input name="id" type="hidden" value="${id}" /> <input
			name="equipmentModel" type="text" value="${equipmentModel}" /></td>
		<td>设备型号</td>
		<td><input name="brand" type="text" value="${brand}" /></td>
	</tr>
	<tr class="type-text">
		<td>编号</td>
		<td><input type="text" name="sindex"
			value="${sindex}" /></td>
		<td>资产编号</td>
		<td><input type="text" name="equipmentNo" value="${equipmentNo}" />
		</td>
		
	</tr>
	<tr class="type-text">
		<td>数据采集工作站</td>
		<td><input type="text" name="dataAcquisitionWorkstation"
			value="${dataAcquisitionWorkstation}" /></td>
		<td>设备存放地</td>
		<td><input id="stored" type="text" name="stored"
			value="${stored}" /></td>
	</tr>
	
	<tr class="type-text">
			<td>设备价格</td>
		<td><input type="text" id="fmtPrice" name="fmtPrice" value="${price}" />
		<input type="hidden" id="price" name="price" value="${price}" />
		</td>
		<td>统一编号</td>
		<td><input type="text" name="unitizeNo"
			value="${unitizeNo}" /></td>
	</tr>
	
	<tr class="type-text">
		<td>数量</td>
		<td><input type="text" name="count"
			value="${count}" /></td>
		<td>单位</td>
		<td><input id="unit" type="text" name="unit"
			value="${unit}" /></td>
	</tr>
	
	<tr class="type-text">
		<td>生产厂家</td>
		<td><input type="text" name="factory"
			value="${factory}" /></td>
		<td>出厂编号</td>
		<td><input id="unit" type="text" name="productNo"
			value="${productNo}" /></td>
	</tr>
	
		<tr class="type-text">
		
		<td>出厂日期</td>
		<td><input id="manufacturer" type="text" name="manufacturer"
			value="${manufacturer}" /></td>
			<td>购买日期</td>
		<td><input id="unit" type="text" name="buyDate"
			value="${buyDate}" /></td>
	</tr>
	
	<tr class="type-text">
		<td>责任人</td>
		<td><input type="text" name="officer"
			value="${officer}" /></td>
		<td>资产状态</td>
		<td><pt:code category="2019" name="asstState" default="${asstState }" hasEmpty="false"></pt:code> </td>
	</tr>
	
	<tr class="type-text">
		<td>部门选择</td>
		<td colspan="3"><pt:labels type="insideOrgDept" name="dept"
			prompt="全部" default="${department.id}">
		</pt:labels></td>
	</tr>
	<tr class="type-title">
		<td colspan="4">项目选择</td>
	</tr>
	<tr>
		<td colspan="4"><pt:code name="equipItemList" category="2020"
			toScope="request"></pt:code> <s:checkboxlist name="itemCodes"
			list="#request.equipItemList" listKey="value" listValue="label"
			theme="custom" /></td>
	</tr>
</table>
<div class="type-button"><input type="submit" id="submitbtn"
	class="submit" value="提交" />&nbsp; <input type="button" value="返回"
	class="reset" onclick="history.back()" /></div>
</form>
</body>
</html>
